package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 订单明细表 Mapper 接口
 * </p>
 *
 * @author lwd
 * @since 2023-04-24
 */
@Mapper
public interface OrderDetailMapper{
    /**
     * 批量保存
     * @param orderDetails
     */
    void batchSave(List<OrderDetail> orderDetails);



    /**
     * 根据订单id查询订单明细
     * @param orderId
     * @return
     */
    @Select("select * from order_detail where order_id = #{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);
}
